﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wicresoft.SMS.Data
{
    public class SMSRecord
    {
        public Int32 MsgIdInDbPrimaryKey { get; set; }
        public Int32 UserID { get; set; }
        public Int32 BatchID { get; set; }
        public Int32 State { get; set; }
        public string To { get; set; }
        public string ToMobile { get; set; }
        public string Content { get; set; }
        public string MessageId { get; set; }

    }

    public class KeyandMessageId
    {
        public int MsgIdInDbPrimaryKey { get; set; }
        public string MessageId { get; set; }
    }

    public static class ChangeModel
    {
        public static SMSRecord MessageToSMSRecord(Message msg)
        {
            SMSRecord smsRecord = new SMSRecord();
            smsRecord.BatchID = msg.BatchID;
            smsRecord.UserID = msg.UserID;
            smsRecord.State = msg.State;
            smsRecord.To = msg.To;
            smsRecord.Content = msg.Content;
            smsRecord.MessageId = msg.MessageId;
            smsRecord.MsgIdInDbPrimaryKey = msg.ID;
            smsRecord.ToMobile = msg.To;
            return smsRecord;
        }
    }
}
